﻿# -*-coding:  UTF-8
# @Time    :  2021/9/13 15:55
# @Author  :  Cooper
# @FileName:  rundemo.py
# @Software:  PyCharm
import sys
import main as u1
import second as u2
from PyQt5.QtWidgets import *


class SecondWindow(QMainWindow):
    def __init__(self):
        # super(SecondWindow, self).__init__()
        super().__init__()
        self.ui = u2.Ui_Form()
        self.ui.setupUi(self)

    def slot2(self):
        win.show()
        win2.close()


class MainWindow(QMainWindow):
    def __init__(self, parent=None):
        # super(MainWindow, self).__init__(parent)  # 使用父类的初始化方法来初始化子类，也就是说，子类继承了父类的所有属性和方法。父类属性自然会用父类方法来进行初始化。
        self.ui = u1.Ui_Form()
        self.ui.setupUi(self)

    def slot1(self):
        win2.show()
        win.close()


if __name__ == "__main__":
    app = QApplication(sys.argv)
    win = MainWindow()
    win.show()
    win2 = SecondWindow()
    sys.exit(app.exec_())
